<%@ page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TIFF打印演示</title>
<STYLE> 
.title
{
	background-color: white;
	font-family: Arial,Vernada,Tahoma, sans-serif;
	color: #00008b;
	font-size: 30px;
	text-decoration: underline;
}
 
.table TR TD
{
	font-size:12px;
	text-align: left;
	border-left: #cdcdd5 1px solid;
	
}
.table .gray TD
{
	background-color: #f7f7f8;
  
}
 
body{
font-size:9pt
}
td
{
	padding:2px;
    border-bottom:#cdcdd5 1px dotted;
	
}
.src
{
	margin-left: 100px;
}
 
.STYLE2 {font-size: 12px}
</STYLE>
<script type="text/javascript" src="jatoolsPrinter.js"></script>
<script type="text/javascript"> 
function doPrint(how)
{
	var message = document.getElementById("jmessage");
   message.innerHTML = "";

	//打印文档对象
    var myDoc ={ 
    				onPagePrinted:function(i,size){
					var j = i+1;
					   if(j==size)
					       message.innerHTML +=('所有打印结束,总计'+size+'页');
					   else
						   message.innerHTML +=('第'+j+'页打印结束.<br>');
					
					},
    				tiffStyle:'height:800px',
    				copyrights  :    '杰创软件拥有版权  www.jatools.com'         // 版权声明必须
    			  };
    			  
    // 调用打印方法
 
	if(how == '打印预览...')
    	how = 'printpreview';
                 
   	else if(how == '打印...')
   		how = 'printprompt';
                
   	else
		how = 'print';
 
	var jatoolsPrinter = getJatoolsPrinter();
	jatoolsPrinter.printTIFF('00000001.tif',myDoc ,how);   // 打印前弹出打印设置对话框
	//jatoolsPrinter.printTIFF('00000002.tif',myDoc ,how);   // 打印前弹出打印设置对话框
	
	myDoc.done = function(err){
		if(!err)    
          alert("success");       // 提交表单 
      	else 
          alert(err); 
	}
}
</script>
</head>
<body>
<p> <span class="title">TIFF打印演示</span><span class="src"><a href='javascript:viewSource()'>查看源代码</a></span> </p>
<input type="button" value="打印预览..." onClick="doPrint('打印预览...')">
<input type="button" value="打印..." onClick="doPrint('打印...')">
<input type="button" value="打印" onClick="doPrint('打印')">
<br>
	<p id="jmessage"></p>

<br>
<span class="gray STYLE1"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</span><span class="gray STYLE2"><a href="tiff.zip">下载本示例中的&nbsp;TIFF 图片文件</a></span>
<!-- 插入打印控件 -->
		<object id="ojatoolsPrinter" codebase="jatoolsPrinter.cab#version=10,0,0,0"
        classid="clsid:B43D3361-D075-4BE2-87FE-057188254255" width="0" height="0">
            <embed id="ejatoolsPrinter" type="application/x-vnd.jatoolsPrinter"
            pluginspage="jatoolsPrinter.exe" width="0" height="0"
            />
			</body>
</html>
 

